﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MarginTrading.Entity;
using MarginTrading.Services;

namespace MarginTrading.Forms
{
    public partial class DailyAccReport : Form
    {
        public DailyAccReport()
        {
            InitializeComponent();
        }

        private void GenerateBtn_Click(object sender, EventArgs e)
        {
            //Double dTotalBuy = DailyTransactionsServices.GetTotals("B", "CTC", TradingDate.Value) * -1;
            //Double dTotalSell = DailyTransactionsServices.GetTotals("S", "CTC", TradingDate.Value);
            //MessageBox.Show("Total : " + dTotalSell + " , " + dTotalBuy);

            //Double dTotalBuySettle = DailyTransactionsServices.GetTotalSettlements("B", "CTC", TradingDate.Value) * -1;
            //Double dTotalSellSelttle = DailyTransactionsServices.GetTotalSettlements("S", "CTC", TradingDate.Value);


            //MessageBox.Show("Total Settlements : " + dTotalBuySettle + " , " + dTotalSellSelttle);



            Double dTotalCapRecive = LoanAccountServices.GetBankAccBalance("CTC", TradingDate.Value);
            Double dTotalCapPaymemt = LoanAccountServices.GetLoanAccBalance("CTC", TradingDate.Value);

            //MessageBox.Show("Total loan acc : " + dTotalCapRecive + " , " + dTotalCapPaymemt);


            Double dBrokerRecep = DailyInterestServices.GetAccruedInterest(TradingDate.Value, "CTC");
            Double dBrokerPayemnent = DailyInterestServices.GetInterestIncome(TradingDate.Value, "CTC");

            
            MessageBox.Show("Bank : " + dTotalCapRecive + " \n Loan : " + dTotalCapPaymemt +
            "\n Accrued Int : " + dBrokerRecep + " \n Inter Income : " + dBrokerPayemnent); 




        }
    }
}
